<?php
require_once("../inc/conn.php");
require_once("../inc/session.php");
$name=$_POST["name"];

	//链接数据库
	//通过sql验证用户名
    $sql="select * from userinfo where name='".$name."'";	
	$rs=$conn->query($sql);
	$total=$rs->num_rows;
	//判断
	if($total==0){
		
		echo "<script>window.alert('可以注册！！'); location.href='addinfo.php';</script>";
		
	}else{
		echo "<script>window.alert('已经被注册！！'); location.href='addinfo.php';</script>";
	}


?>